import java.util.ArrayList;
import java.util.List;

public class MenuCategory implements MenuItem {
    private String name;
    private List<MenuItem> menuItems;

    public MenuCategory(String name) {
        this.name = name;
        this.menuItems = new ArrayList<>();
    }

    @Override
    public void add(MenuItem menuItem) {
        menuItems.add(menuItem);
    }

    @Override
    public void remove(MenuItem menuItem) {
        menuItems.remove(menuItem);
    }

    @Override
    public List<MenuItem> getChildren() {
        return menuItems;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public double getPrice() {
        throw new UnsupportedOperationException("无法找到菜单种类.");
    }
}